<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('接口管理列表')" />
    <style>
        .font_div {
            font-weight: bold;
            font-size: 16px;
            margin-top: 10px;
        }
        .main_div {
            background-color: #02A7F0;color:white;height: 210px;
        }
    </style>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse" style="margin-bottom:15px">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>上报单位：</label>
                            <input type="text" id="dayBegin" onchange="queryTableData()" placeholder="yyyy-MM-dd" th:value="${dayBegin}" autocomplete="off">
                        </li>
                        <li>
                            <label>上报项目：</label>
                            <input type="text" id="dayEnd" onchange="queryTableData()" placeholder="yyyy-MM-dd" th:value="${dayEnd}" autocomplete="off">
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="queryTableData()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-4" th:each="item:${reports}">
            <div class="alert alert-success main_div" th:attr="idReport=${item.idReport}">
                <span style="float: right"><a href="#" style="color: white" onclick="showNote(this)">说明>></a></span>
                <div class="font_div" style="font-size: 20px"><a href="#" style="color: white" onclick="toDetail(this)" th:attr="url=${item.url},title=${item.na}">上报项目: <span th:text="${item.na}"></span></a></div>
                <div class="font_div">上报单位: <span th:text="${item.naUnit}"></span> </div>
                <div class="font_div">负责人: <span th:text="${item.naEmp}"></span> </div>
                <div class="font_div">有效期: <span th:text="${item.monthBegin}"></span>~<span th:text="${item.monthEnd}"></span> </div>
                <div class="font_div"><a href="#" style="color: #0000FD">数据维护</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" style="color: #0000FD" onclick="downloadFile(this)" th:attr="name=${item.na}">附件下载</a> </div>
            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "base/report";
    function showNote(ele) {
        var idReport = $(ele).parent().parent().attr("idReport");
        $.modal.open('上报项目介绍', prefix + "/toDetail/"+idReport+"?type=no");
    }
    function toDetail(ele) {
        var url = $(ele).attr("url");
        var title = $(ele).attr("title");
        $.modal.openTab(title, url);
    }
    function add() {
        $.modal.open('添加上报项目', prefix + "/add");
    }
    function downloadFile(ele) {
        var fileName = $(ele).attr("name");
        $.modal.confirm("是否要下载["+fileName+"]相关文件？", function() {
            window.location.href = ctx + "common/download?fileName=report/"+fileName+".zip";
        });
    }
</script>
</body>
</html>